import "package:ct_pa_majordomo/utils/request.dart";
import "package:dio/dio.dart";

class WithdrawApi {
  /* 提现申请 */
  Future<Map> withdraw(Map<String, dynamic>? data) async {
    Response response = await request.post(
      "apartment/withdraw",
      data: data,
    );
    return response.data ?? {};
  }

  /* 提现申请详情 */
  Future<Map> withdrawDetail(int withdrawId) async {
    Response response = await request.get(
      "apartment/withdraw/$withdrawId",
    );
    return response.data ?? {};
  }

  /* 提现申请列表 */
  Future<Map> withdrawList(Map<String, dynamic>? data) async {
    Response response = await request.get(
      "apartment/withdraw/list",
      queryParameters: data,
    );
    return response.data ?? {};
  }

  /* 提现申请详细列表 */
  Future<Map> withdrawDetailList(Map<String, dynamic>? data) async {
    Response response = await request.get(
      "apartment/withdraw/detail-list",
      queryParameters: data,
    );
    return response.data ?? {};
  }

  /* 提现关联账单列表 */
  Future<Map> withdrawBillList(int withdrawId, {Map<String, dynamic>? queryParams}) async {
    Response response = await request.get(
      "apartment/withdraw/associate-bills/$withdrawId",
      queryParameters: queryParams,
    );
    return response.data ?? {};
  }
}

WithdrawApi withdrawApi = WithdrawApi();